package com.abel.cloud.gateway.filter;

import com.alibaba.fastjson.JSONArray;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.core.Ordered;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Author: Abel.lin
 * Date: 2021/5/12 14:25
 * Company: Abel Studio
 * Copyright: Copyright (c) 2017
 * Description: 自定义过滤器
 */
@Slf4j
public class UserGatewayFilter implements GatewayFilter, Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        ServerHttpRequest request = exchange.getRequest();
        log.info("=== user filter request URI:{} ===", request.getURI());


        return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
